/**
 * Copyright  (c) 2009-2010 Wilmar IT Service,  Inc.   
 * All  rights  reserved. 
 */
package com.wilmar.process.webservice.server.impl;

import java.io.File;

import javax.jws.WebService;

import com.wilmar.process.core.services.api.ISystemProcessDefinitionService;
import com.wilmar.process.entity.ProcessReleaseNotes;
import com.wilmar.process.exception.ObjectNotFoundException;
import com.wilmar.process.webservice.server.api.ISystemProcessDefintionWebService;

/**
 * @author makubex Email:makubexnet@gmail.com
 * @version 1.0.0 May 7, 2010
 * @since 1.0.0
 */
@WebService(endpointInterface = "com.wilmar.process.webservice.server.api.ISystemProcessDefintionWebService")
public class SystemProcessDefinitionWebServiceImpl implements
		ISystemProcessDefintionWebService {
	private ISystemProcessDefinitionService systemProcessDefinitionService;

	/**
	 * @return the systemProcessDefinitionService
	 */
	public ISystemProcessDefinitionService getSystemProcessDefinitionService() {
		return systemProcessDefinitionService;
	}

	/**
	 * @param systemProcessDefinitionService
	 *            the systemProcessDefinitionService to set
	 */
	public void setSystemProcessDefinitionService(
			ISystemProcessDefinitionService systemProcessDefinitionService) {
		this.systemProcessDefinitionService = systemProcessDefinitionService;
	}

	/**
	 * @see com.wilmar.process.webservice.server.api.ISystemProcessDefintionWebService#deployProcessDefinition(java.io.File,
	 *      com.wilmar.process.entity.ProcessReleaseNotes)
	 */
	public void deployProcessDefinitionByFile(File definitionPackage,
			ProcessReleaseNotes processReleaseNotes) {
		this.systemProcessDefinitionService.deployProcessDefinition(
				definitionPackage, processReleaseNotes);
	}

	/**
	 * @see com.wilmar.process.webservice.server.api.ISystemProcessDefintionWebService#getProcessDescriptionById(java.lang.String)
	 */
	public String getProcessDescriptionById(String processDefinitionId)
			throws ObjectNotFoundException {
		String description = this.systemProcessDefinitionService
				.getProcessDescriptionById(processDefinitionId);
		return description;
	}

	/**
	 * @see com.wilmar.process.webservice.server.api.ISystemProcessDefintionWebService#deployProcessDefinition(java.lang.String,
	 *      com.wilmar.process.entity.ProcessReleaseNotes)
	 */
	public void deployProcessDefinitionByString(String definitionString,
			ProcessReleaseNotes processReleaseNotes) {
		this.systemProcessDefinitionService.deployProcessDefinition(
				definitionString, processReleaseNotes);
	}

}
